package com.power.project.model;


import com.power.common.domain.BaseModel;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.*;

import javax.persistence.*;
import java.io.Serializable;
import java.util.HashMap;
import java.util.Map;

/**
*  参与项目人员实体类
*/

@Entity
@ApiModel(value="参与项目人员")
@Data
@Table(name="P_projectuser")
@NoArgsConstructor
@EqualsAndHashCode(callSuper = false)
//@IdClass(P_projectuser.P_projectuserPK.class) 用于复合组件
public class P_projectuser extends BaseModel implements Serializable {
	
	private static final long serialVersionUID = 1L;
	
    @Id
    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Column(nullable = false)
    @ApiModelProperty(value = "")
    private Integer id;

    @ApiModelProperty(value = "用户id")
    private String wwuserid;

    @ApiModelProperty(value = "姓名")
    private String wwusername;

    @ApiModelProperty(value = "项目id")
    private Integer projectid;

    @ApiModelProperty(value = "是否我的默认项目")
    private Integer isdefault;


    public Map<String, Object> parseMap() {
        Map<String, Object> map=new HashMap<>();
        map.put("id", this.getId());
        map.put("wwuserid", this.getWwuserid());
        map.put("wwusername", this.getWwusername());
        map.put("projectid", this.getProjectid());
        map.put("isdefault", this.getIsdefault());
        return map;
    }

    public Integer getId() {
        return id;
    }

    public void setId(Serializable id) {
        this.id = (Integer) id;
    }

    public Serializable getPrimaryKey() {
        return id;
        // return new P_projectuserPK(id, id2); 用于复合主键，请手动创建内部静态类
    }

    public void setPrimaryKey(Serializable key) {
        this.id = (Integer)key;

        //P_projectuserPK pk = (P_projectuserPK) key; 用于复合主键
        //this.id = pk.getId();
        //this.id2 = pk.getId2();
    }

}